$('.shop').prop('isExpand', false).click(function(){
    let isExpand = $('#hit').prop('isExpand')
        if (!isExpand) {
            $('#hit').prop('isExpand', true).slideDown(200)
    
        } else {
            $('#hit').prop('isExpand', false).slideUp(200)
        }
    
    
        $.ajax({
            url:'http://chst.vip:1234/api/getgsshop',
            success:function(res){
                console.log(res);
              let data=res.result
                let html = ''
                let hitC = document.querySelector('#hitC')
                data.forEach(item=>{
                    html+=`
                    <li data-shop="${item.shopId}">
                        ${item.shopName}
                    </li>
                    `
                })
                hitC.innerHTML = html
                $('.shop').toggleClass('show');
                setHtml(shopid, areaid);
                console.log(shopid);
            }
        })
    }) 
        
    
    
    
    $('.place').prop('isExpand', false).click(function(){
        let isExpand = $('#hit').prop('isExpand')
        if (!isExpand) {
            $('#hit').prop('isExpand', true).slideDown(200)
    
        } else {
            $('#hit').prop('isExpand', false).slideUp(200)
        }
    
        $.ajax({
            url:'http://chst.vip:1234/api/getgsshoparea',
            success:function(res){
                console.log(res);
                let data= res.result
                let html = ''
                let hitC = document.querySelector('#hitC')
                data.forEach(item=>{
                    html+=`
                    <li data-shop="${item.areaId}">
                        ${item.areaName}
                    </li>
                    `
                })
                hitC.innerHTML = html
            }
        })
    })
    
    
    
    
    
    var shopid=0
    var areaid = 0
    function setHtml(shopid,areaid){
        $.ajax({
            url: 'http://chst.vip:1234/api/getgsproduct',
            data: {
                shopid: shopid,
                areaid: areaid
            },
            success: function (res) {
                console.log(res);
                let data = res.result
                let merchandiseS = document.querySelector('#merchandiseS')
                let html=''
                data.forEach(item=>{
                    html+=`
                    <li>
                    <a href="">
                        <img src="${item.productImg}" alt="">
                        <h4>${item.productName}</h4>
                        <p>${item.productPrice}</p>
                    </a>
                </li>
                    `
                })
                merchandiseS.innerHTML = html
            }
        })
    }
    setHtml(shopid,areaid)